<?php
/**
 *+-----------------------------------------------------------------------+
 *| DOMAdapter v0.1 - 13 Oct 2006                                         |
 *+-----------------------------------------------------------------------+
 *|  Diego do Nascimento Feitosa                                          |
 *|  diego@dnfeitosa.com                                                  |
 *|  www.dnfeitosa.com                                                    |
 *|  São Paulo/SP - Brasil                                                |
 *+-----------------------------------------------------------------------+
 *| DOMAdapter is free software; you can redistribute it and/or modify    |
 *| it under the terms of the GNU General Public License as published by  |
 *| the Free Software Foundation; either version 2 of the License, or     |
 *| (at your option) any later version.                                   |
 *|                                                                       |
 *| DOMAdapter is distributed in the hope that it will be useful, but     |
 *| WITHOUT ANY WARRANTY; without even the implied warranty of            |
 *| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     |
 *| General Public License for more details.                              |
 *|                                                                       |
 *| You should have received a copy of the GNU General Public License     |
 *| along with DOMAdapter; if not, write to the Free Software             |
 *| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA              |
 *| 02111-1307  USA                                                       |
 *+-----------------------------------------------------------------------+
**/
class DOMAdapter {
	function &createDocument($root = null) {
		if (version_compare(phpversion(), "5.0.0") == -1) {
			require_once("DOM.inc");
			$doc = &new _Document("1.0");
		} else {
			$doc = new DOMDocument("1.0");
		}
		if (!is_null($root)) {
			$elem = $doc->createElement($root);
			$doc->appendChild($elem);
		}
		return $doc;
	}
}
?>
